// 在这个文件中对于 所有的 内容进行渲染
import React, { Component } from 'react'
import ReactDOM from 'react-dom'
import { Router, Route, hashHistory, IndexRoute } from 'react-router'
import Home from './views/Home'
import Login from './views/Login'
import Detail from './views/Detail'
class App extends Component {
    render() {
        return (
            <div>{this.props.children}</div>
        )
    }
}

const router = (
    <Router history={hashHistory}>
        <Route path="/" component={App}>
            <IndexRoute component={Home} />
            <Route path="/home" component={Home} />
            <Route path="/login" component={Login} />
            <Route path="/detail/:id" component={Detail} />
        </Route>
    </Router>
)

ReactDOM.render(router, document.getElementById('root'))
